<?php

/**
 * 控制器基类
 *
 * 建立基础控制器，模型、视图衔接
 *
 * @author Lan <lanyg.com@gmail.com>
 * @link http://www.lanyg.com/projects/lanp
 * @copyright Copyright &copy; 2011-2012 Yanguang Lan (www.lanyg.com)
 * @license LGPL (http://www.gnu.org/licenses/lgpl.html)
 * @version $Id$
 */

/**
 * MVC_Controller
 *
 * @access public
 * @author Lan
 */

class MVC_Controller
{
    /**
     * 建立 event 类实例属性
     *
     * @var object $event
     * @access public
     */

    public $event = null;

    /**
     * 建立 load 类实例属性
     *
     * @var object $load
     * @access public
     */

    public $load = null;

    /**
     * 建立 view 类实例属性
     *
     * @var object $view
     * @access public
     */

    public $view = null;

    /**
     * 构造函数
     *
     * @access public
     */

    public function  __construct()
    {
        MVC::instance($this, 'controller');

        $this->event = MVC::instance(null,'event');

        $this->load = new MVC_Load;
        
        $this->view = new MVC_View;
    }

    /**
     * 默认方法
     *
     * @access public
     */

    public function indexAction()
    {

    }

    /**
     * 魔术方法
     *
     * @access public
     */

    public function  __call($function,  $arguments)
    {
        throw new Exception("Unknown controller method '{$function}'");
    }
}
?>